define(['text!./selfInfo.html', 'css!./selfInfo.css'], function( html) {
	avalon.templateCache['selfInfo']=html;
	var vm = avalon.define({
	    $id: "selfInfo",
	    name:'',
	    phone:'',
	    tel:'',
	    detailSelf:function(){
	    	if(!vm.name){
	    		msgbox('提示','请输入您的昵称');
	    		return;
	    	}
	    	if(!vm.phone){
	    		msgbox('提示','请输入您的手机号或者座机号');
	    		return;
	    	}
	    	var family={
	    		name:vm.name,
	    		phone:vm.phone,
	    		tel:vm.tel
	    	}
	    	setstorage('family',family);
	    	Router.go("/detailSelf/detailSelf");
	    },
	    back:function(){
	    	Router.go("/Home/Home");
	    },
	    init:function(){
	    	if(getstorage('family')){
	    		var user=JSON.parse(getstorage('family'));
	    		vm.name=user.userName;
	    		vm.phone=user.phone;
	    		vm.tel=user.tel;
	    	}else{
	    		vm.name="";
	    		vm.phone="";
	    		vm.tel='';
	    	}
	    }
  });
});